<template>
  <div class="container">
    <el-row type="flex" justify="space-between">
      <!-- 订单表单 -->
      <div class="main">
        <OrderForm
          v-if="formData"
          :data="formData"
          @changePrice="changePrice"
        />
      </div>

      <!-- 侧边栏 -->
      <orderAside v-if="formData" :data="formData" :priceInfo="priceInfo" />
    </el-row>
  </div>
</template>

<script>
import OrderForm from "@/components/air/orderForm";
import orderAside from "@/components/air/orderAside";

export default {
  data() {
    return {
      formData: null,
      priceInfo: {}
    };
  },
  components: {
    OrderForm,
    orderAside
  },
  created() {
    let { query } = this.$route;
    this.$axios({
      url: `airs/${query.id}`,
      params: {
        seat_xid: query.seat_xid
      }
    }).then(res => {
      this.formData = res.data;
      // console.log("订单主页", this.formData);
    });
  },
  methods: {
    changePrice(priceInfo) {
      this.priceInfo = priceInfo;
    }
  }
};
</script>

<style lang="less" scoped>
.container {
  width: 1000px;
  margin: 20px auto;
}

/*aside*/
.aside {
  width: 350px;
  height: fit-content;
  border: 1px #ddd solid;
}
</style>
